// components/my-cartDetail/my-cartDetailBackground/my-cartDetailBackground.js
import eventBus from '../../../eventBus';
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    displayStatus:'none'
  },

  /**
   * 组件的方法列表
   */
  methods: {

  },
  lifetimes:{
    attached(){
      eventBus.on('changeBackground',()=>{
        if(this.data.displayStatus==='none'){
          this.setData({
            displayStatus:"block"
          })
        }else{
          this.setData({
            displayStatus:"none"
          })
        }
      })
    },
    detached(){
      eventBus.off('changeBackground')
    }
  }
})
